#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
    float num = 0;
    scanf("%f", &num);
    printf("%d", (int)num % 10);
    return 0;
}